﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SearchResults.ascx.cs"
    Inherits="usercontrols_SearchResults" %>
<%@ Register Src="~/controls/usercontrols/Error.ascx" TagPrefix="uc" TagName="Error" %>
<table class="contentTable">
    <tr>
        <td align="center" colspan="2">
            <uc:Error ID="ucErrors" runat="server" />
        </td>
    </tr>
    <tr>
        <td align="center" style="padding: 10px 0 10px 0" colspan="2">
            <asp:LinkButton ID="lbViewGameResults" runat="server" Text="Game zoekresultaten"
                ToolTip="Bekijk game zoekresultaten" Enabled="false" OnClick="SeeViewGameResults" />&nbsp;|
            <asp:LinkButton ID="lbViewPublisherResults" runat="server" Text="Uitgever zoekresultaten"
                ToolTip="Bekijk uitgever zoekresultaten" OnClick="SeeViewPublisherResults" />
        </td>
    </tr>
    <asp:MultiView ID="mvSearchResults" runat="server" ActiveViewIndex="0">
        <asp:View ID="vGameResults" runat="server">
            <tr>
                <td colspan="2">
                    <asp:GridView ID="gvGameResults" AutoGenerateColumns="false" runat="server" GridLines="Horizontal"
                        OnSorting="SortSearchResults" AllowSorting="true" BorderStyle="Outset" CellPadding="1"
                        CssClass="grid" OnRowDataBound="gvGameResults_RowDataBound">
                        <RowStyle CssClass="gridroweven" />
                        <AlternatingRowStyle CssClass="gridrowodd" />
                        <Columns>
                            <asp:TemplateField HeaderStyle-Width="16%">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ibtnGamePicture" runat="server" CommandArgument='<%# Eval("GameNr") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Artikelnaam" SortExpression="Naam" HeaderStyle-Font-Bold="true"
                                HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="32%">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbGameTitle" runat="server" CommandArgument='<%# Eval("GameNr") + "_" + Eval("Platform") %>'
                                        Text='<%# Eval("Title") %>' ToolTip='<%# Eval("DescriptionShort") %>' OnClick="GetGameDetails" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Platform" SortExpression="Platform" HeaderStyle-Font-Bold="true"
                                HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="21%">
                                <ItemTemplate>
                                    <asp:Label ID="lblGamePlatform" runat="server" Text='<%# Eval("Platform") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Voorraad" SortExpression="Voorraad" HeaderStyle-Font-Bold="true"
                                HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="10%">
                                <ItemTemplate>
                                    <asp:Label ID="lblGameStock" runat="server" Text='<%# Eval("Stock") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Prijs" SortExpression="Prijs" HeaderStyle-Font-Bold="true"
                                HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="8%">
                                <ItemTemplate>
                                    <asp:Label ID="lblGamePrice" runat="server" Text='<%# Eval("Price") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="13%">
                                <ItemTemplate>
                                    <asp:Button ID="btnOrderGame" runat="server" Text="Bestel" CssClass="buttonRed" ToolTip="Voeg artikel toe aan winkelwagen"
                                        OnClick="AddToCart" CommandArgument='<%# Eval("GameNr") + "_" + Eval("Platform") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="lblCurrentGameResults" runat="server" /><asp:Label ID="lblGameSearchResults"
                        runat="server" Text="0" />
                </td>
                <td align="right">
                    <asp:LinkButton ID="lbGamesPrevious" runat="server" Text="Terug" OnClick="GamesPageBack" />&nbsp;-&nbsp;<asp:LinkButton
                        ID="lbGamesNext" runat="server" Text="Volgende" OnClick="GamesPageNext" />
                </td>
            </tr>
        </asp:View>
        <asp:View ID="vPublisherResults" runat="server">
            <tr>
                <td colspan="2">
                    <asp:GridView ID="gvPublisherResults" AutoGenerateColumns="false" runat="server"
                        GridLines="Horizontal" OnSorting="SortSearchResults" AllowSorting="true" BorderStyle="Outset"
                        CellPadding="1" CssClass="grid" OnRowDataBound="gvPublisherResults_RowDataBound">
                        <RowStyle CssClass="gridroweven" />
                        <AlternatingRowStyle CssClass="gridrowodd" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:ImageButton ID="ibtnPublisherLogo" runat="server" CommandArgument='<%# Eval("PublisherId") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Naam" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Left"
                                SortExpression="Naam">
                                <ItemTemplate>
                                    <asp:Label ID="lblPublisherName" runat="server" Text='<%# Eval("Name") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <asp:Label ID="lblCurrentPublisherResults" runat="server" /><asp:Label ID="lblPublisherSearchResults"
                        runat="server" Text="0" />
                </td>
                <td align="right">
                    <asp:LinkButton ID="lbPublisherPrevious" runat="server" Text="Terug" OnClick="PublishersPageBack" />&nbsp;-&nbsp;<asp:LinkButton
                        ID="lbPublisherNext" runat="server" Text="Volgende" OnClick="PublishersPageNext" />
                </td>
            </tr>
        </asp:View>
    </asp:MultiView>
</table>
